package ee.ts022.tuum.domain;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="contract")
public class Contract {
	
	@Id
	@Column(name="contract")
	@SequenceGenerator(name="pk_sequence",sequenceName="s_contract")
	@GeneratedValue(strategy=GenerationType.AUTO, generator="pk_sequence" )
	private int contract;
	
	@OneToOne
	@JoinColumn(name="customer")
	private Customer customer;
	
	@Column(name="cnt_number")
	private String cntNumber;
	
	@Column(name="name")
	private String name;
	
	@Column(name="description")
	private String description;
	
	@Column(name="valid_from")
	private Date validFrom;
	
	@Column(name="valid_to")
	private Date validTo;
	
	@Column(name="created")
	private Date created;
	
	@Column(name="updated")
	private Date updated;
	
	@Column(name="conditions")
	private String conditions;
	
	@Column(name="note")
	private String note;
	
	@Column(name="value_amount")
	private Double valueAmount;
	
	@OneToOne
    @JoinColumn(name="contract_status_type")
	private ContractStatusType contractStatusType;
	
	@OneToOne
	@JoinColumn(name = "contract_type")
	private ContractType contractType;
	
	@OneToOne
    @JoinColumn(name="created_by")
	private Employee createdBy;
	
	@OneToOne
    @JoinColumn(name="updated_by")
	private Employee updatedBy;

	public int getContract() {
		return contract;
	}

	public void setContract(int contract) {
		this.contract = contract;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public String getCntNumber() {
		return cntNumber;
	}

	public void setCntNumber(String cntNumber) {
		this.cntNumber = cntNumber;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getValidFrom() {
		return validFrom;
	}

	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}

	public Date getValidTo() {
		return validTo;
	}

	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public String getConditions() {
		return conditions;
	}

	public void setConditions(String conditions) {
		this.conditions = conditions;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Double getValueAmount() {
		return valueAmount;
	}

	public void setValueAmount(Double valueAmount) {
		this.valueAmount = valueAmount;
	}

	public ContractStatusType getContractStatusType() {
		return contractStatusType;
	}

	public void setContractStatusType(ContractStatusType contractStatusType) {
		this.contractStatusType = contractStatusType;
	}

	public ContractType getContractType() {
		return contractType;
	}

	public void setContractType(ContractType contractType) {
		this.contractType = contractType;
	}

	public Employee getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Employee createdBy) {
		this.createdBy = createdBy;
	}

	public Employee getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(Employee updatedBy) {
		this.updatedBy = updatedBy;
	}

	@Override
	public String toString() {
		return "Contract [contract=" + contract + ", customer=" + customer
				+ ", name=" + name + "]";
	}
	
	
}
